 # your own env, in your .zshrc, source this file

# Fix python crash with vim and YCM plugin
export DYLD_FORCE_FLAT_NAMESPACE=1
export DISABLE_AUTO_TITLE='true'
# export INTELLIJ_HOME=/Applications/IntelliJ\ IDEA\ 13\ CE.app/Contents/MacOS/
#PATH=$IDEA_HOME $PATH
export PYTHONIOENCODING=utf-8
export EDITOR='nvim'
# export LC_ALL=zh_CN.UTF-8


alias code='code --user-data-dir ="~/.vscode-root"'
alias py='python3 '
alias py3s='python3.6 -m http.server'
alias nv="nvim "
alias run='python3 manage.py runserver 0.0.0.0:8000'
# alias runs='python manage.py shell'
alias monitor="when-changed -r -v -1 . "    # pip install when-changed
alias go_monitor_run="when-changed -r -v -1 . go run"
alias refresh_chrome=" osascript -e 'tell application \"Google Chrome\" to tell the active tab of its first window to reload' "
alias flush_watch_refresh_chrome=" when-changed -v -r -1 -s ./ osascript -e 'tell application \"Google Chrome\" to tell the active tab of its first window to reload' "
alias prettyjson='python -m json.tool'

# youbute
alias download_youbute_mp3='youtube-dl --extract-audio --audio-format mp3 --no-playlist'
alias download_youbute='youtube-dl -f bestvideo+bestaudio '
alias download_youbute_mp3_proxy='youtube-dl --proxy 'socks5://127.0.0.1:1080' --extract-audio --audio-format mp3 '
alias download_youbute_proxy='youtube-dl --proxy 'socks5://127.0.0.1:1080' -f bestvideo+bestaudio '

# for php
# export PATH="$(brew --prefix php70)/bin:$PATH"
#export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
# alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php70.plist"
# alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php70.plist"
# alias php-fpm.restart='php-fpm.stop && php-fpm.start'


# export NVM_DIR="/Users/wnn/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

# #nvm use 0.12.0
# alias nvmm='nvm use 8.10.0'

# source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"

# export GOPATH=$HOME/go    # don't forget to change your path correctly!
# # export GOROOT=/usr/local/opt/go/libexec
# export PATH=$PATH:$GOPATH/bin
# export PATH=$PATH:$GOROOT/bin
# alias updatedb='sudo /usr/libexec/locate.updatedb'

# openssl
# export PATH="/usr/local/opt/openssl/bin:$PATH"
# export LDFLAGS="-L/usr/local/opt/openssl/lib"
# export CPPFLAGS="-I/usr/local/opt/openssl/include"
# export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

# init 会每次启动的时候载入虚拟环境
#eval "$(pyenv init -)"
#eval "$(pyenv virtualenv-init -)"

# http proxy
function unset_httpproxy() {
    unset https_proxy; unset http_proxy
}

function ssr_httpproxy() {
  export http_proxy=http://127.0.0.1:1087
  export https_proxy=http://127.0.0.1:1087
}

function ss_gitproxy() {
    git config --global https.proxy http://127.0.0.1:1087
    git config --global https.proxy https://127.0.0.1:1087
}

function unset_gitproxy() {
    git config --global --unset http.proxy
    git config --global --unset https.proxy
}

# https://github.com/huan/swagger-edit
# function swagger-edit() {
#   docker run -ti --rm --volume="$(pwd)":/swagger -p 8080:8080 zixia/swagger-edit "$@"
# }